home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / dbase / techs.zip / TECH22.ZIP / CAPS.ASM next >
Assembly Source File  |  1985-11-01  |  1KB  |  53 lines

  1. ; Program ...: Caps.ASM
  2. ; Author ....: Ralph Davis
  3. ; Date ......: September 1, 1985
  4. ; Note ......: Turns the Capslock key on or off.  Note that this
  5. ;              listing includes the set of instructions for
  6. ;              turning the Capslock key both on and off.
  7. ;
  8. ;
  9.     .LFCOND            ; List false conditionals.
  10.     PAGE 60,132        ; Page length 60, width 132
  11.  
  12. COM    EQU     0        ; Assemble as .BIN file
  13. D3    EQU     1        ; for Developer's Release.
  14.         
  15. CODESEG SEGMENT BYTE PUBLIC 'CODE'
  16. CAPSLOCK PROC    FAR
  17.     ASSUME CS:CODESEG
  18.     IF    COM
  19.        ORG    100H        ; ORG at 100H for .COM file.
  20.     ENDIF
  21. START:    PUSH    AX        ; Save registers.
  22.     PUSH     DS
  23.     PUSH     SI
  24.      PUSH     CX
  25.     MOV     AX,40H          ; Point DS to system data segment
  26.     MOV     DS,AX
  27.     MOV    SI,17H        ; and SI to KB_FLAG.
  28.     MOV     CX,2        ; Set counter to perform
  29.                 ; loop twice.
  30. LOOPER:    MOV    BL,[SI]        ; Load flag contents 
  31.     AND     BL,0BFH        ; and turn off Capslock bit.
  32.                 ; Note that the instruction 
  33.                 ; to turn the Capslock key on
  34.                 ; is  OR BL,40H.
  35.                 ; Every other instruction is
  36.                 ; identical.
  37.     MOV    [SI],BL        ; Replace flag.
  38.     INC    SI        ; Point to KB_FLAG_1
  39.     LOOP    LOOPER        ; and do the same thing.
  40.     POP    CX        ; Restore registers.
  41.     POP    SI
  42.     POP    DS
  43.     POP    AX
  44.     IF    COM
  45.        INT    20H        ; INT 20H if .COM file.
  46.     ELSE
  47.        RET            ; Far return to dBASE III.
  48.     ENDIF
  49. ;
  50. CAPSLOCK ENDP
  51. CODESEG ENDS
  52.     END    START
  53.